package com.csliubo.eclipse.plugin.sqlgenerator.constants;

import com.csliubo.eclipse.plugin.sqlgenerator.util.StringUtils;

/**
 * 输出格式
 * 
 * @author liubo.cs@hotmail.com
 * @version 1.0
 * @date 2011-3-5
 */
public enum OutputFormat {

	EXCEL("excel"), WIKI("wiki");
	private String value;

	private OutputFormat(String value) {
		this.value = value;
	}

	public String getValue() {
		return value;
	}

	public static OutputFormat getFormatByValue(String value) {
		if (StringUtils.isBlank(value)) {
			return null;
		}
		for (OutputFormat format : values()) {
			if (StringUtils.equals(format.getValue(), value)) {
				return format;
			}
		}
		return null;
	}
}
